<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/view/modules/sys/include/taglib.jsp"%>
<%@ include file="/WEB-INF/view/modules/sys/include/head.jsp"%>
<div class="main-container">
    <div class="padding-md">
        <div class="col-md-6">
            <div class="smart-widget">
                <div class="smart-widget-header">
                    用户积分查找
                    <span class="smart-widget-option">
										<span class="refresh-icon-animated">
											<i class="fa fa-circle-o-notch fa-spin"></i>
										</span>
			                            <a href="#" class="widget-toggle-hidden-option">
			                                <i class="fa fa-cog"></i>
			                            </a>
			                            <a href="#" class="widget-collapse-option" data-toggle="collapse">
			                                <i class="fa fa-chevron-up"></i>
			                            </a>
			                            <a href="#" class="widget-refresh-option">
			                                <i class="fa fa-refresh"></i>
			                            </a>
			                            <a href="#" class="widget-remove-option">
			                                <i class="fa fa-times"></i>
			                            </a>
			                        </span>
                </div>
                <div class="smart-widget-inner">
                    <div class="smart-widget-hidden-section">
                        <ul class="widget-color-list clearfix">
                            <li style="background-color:#20232b;" data-color="widget-dark"></li>
                            <li style="background-color:#4c5f70;" data-color="widget-dark-blue"></li>
                            <li style="background-color:#23b7e5;" data-color="widget-blue"></li>
                            <li style="background-color:#2baab1;" data-color="widget-green"></li>
                            <li style="background-color:#edbc6c;" data-color="widget-yellow"></li>
                            <li style="background-color:#fbc852;" data-color="widget-orange"></li>
                            <li style="background-color:#e36159;" data-color="widget-red"></li>
                            <li style="background-color:#7266ba;" data-color="widget-purple"></li>
                            <li style="background-color:#f5f5f5;" data-color="widget-light-grey"></li>
                            <li style="background-color:#fff;" data-color="reset"></li>
                        </ul>
                    </div>
                    <div class="smart-widget-body">
                        <form action="${ctx}/grade/gradeSelectById" method="post" class="form-horizontal no-margin" id="type-constraint"  novalidate="">
                            <div class="form-group">
                                <label class="control-label col-lg-3">输入用户id查询结果</label>
                                <div class="col-lg-9">
                                    <input type="text" name="userId" class="form-control input-sm" required >
                                </div><!-- /.col -->
                            </div><!-- /form-group -->
                            <div class="text-right m-top-md">
                                <button type="submit" class="btn btn-info">查找</button>
                            </div>
                        </form>
                        <%--根据从GradeControlSelect返回的page信息输出相应的值--%>
                        <c:choose>
                            <c:when test="${page eq 'error'}">
                                <c:out value="没有此用户"></c:out>
                            </c:when>
                            <c:when test="${page != null || page.size() > 0  }">
                                <div class="padding-md">
                                    <div class="smart-widget-body">
                                        <div class="smart-widget-body">
                                            <table class="table table-hover">
                                                <thead>
                                                <tr><th>积分id</th><th>用户id</th><th>积分</th><th>级别</th></tr>
                                                <c:forEach items="${page}" var="grade">
                                                <tr>
                                                    <td>${grade.id}</td>
                                                    <td>${grade.userId}</td>
                                                    <td>${grade.value}</td>
                                                    <td>${grade.level}</td>
                                                </tr>
                                                </c:forEach>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </c:when>
                        </c:choose>
                    </div>
                </div><!-- ./smart-widget-inner -->
            </div><!-- ./smart-widget -->
        </div>
    </div>
</div>

<%@include file="/WEB-INF/view/modules/sys/include/footerlib.jsp"%>
</body>
</html>